﻿using Microsoft.AspNetCore.Builder;

namespace Jst.Infrastructure.Web
{
    public static class SwaggerUIConfig
    {
        public static IApplicationBuilder UseCustomSwaggerUI(this IApplicationBuilder app)
        {
            return app.UseSwaggerUI(c =>
            {
                var versions = new[] { "v1", "v2" };
                foreach (var version in versions)
                {
                    c.SwaggerEndpoint(
                        $"/swagger/{version}/swagger.json",
                        $"阿金的版本管理平台 API 文档 {version}");
                }
            });
        }
    }
}
